<template>
	<view>
		<view class="box">
			<view class="menu_content_box_page">
				<view class="pa15">

					<view class="mt15 area_block_1" v-for="item, index in list" :key="index" v-if="list.length > 0">
						<view class="flex_box">
							<view class="re mr25">
								<image src="item.imgUrl" class="img17 vt"></image>
							</view>
							<view class="item" @tap="toDetail(item.id)">
								<view class="df fldc jcsb hp100">
									<view class="fs28 lh34 cor_333 ell">{{item.title}}</view>
									<view class="flex_box aic">
										<view class="item">
											<view class="fs22 cor_808">下单时间：{{item.createTime}}</view>
										</view>
										<view class="df aic">
											<image src="="/static/icon_location.png" class="img3"></image>
											<view class="ml5 fs22 cor_808">{{item.place}}</view>
										</view>
									</view>
									<view class="flex_box aic">
										<view class="item">
											<view class="fs22 cor_808">下订单人：{{item.customer}}</view>
										</view>
										<view class="fs22 cor_808">{{item.phone}}</view>
									</view>
								</view>
							</view>
						</view>
						<image-if="item.state == 3" src="/static/icon_watermark_9.png" class="watermark_img_pos">
						</image>
						<image-if="item.state == 2" src="/static/icon_watermark_8.png" class="watermark_img_pos">
						</image>
						<image-if="item.state == 1" src="/static/icon_watermark_7.png" class="watermark_img_pos">
						</image>
					</view>

					<view v-if="list.length == 0" style="width: 100%;height: 100vh">
						<view style="height: 200rpx;"></view>
						<image src="../../static/excavator.png" style="width: 100%; padding: 100rpx 200rpx;"></image>
						<view style="width: 100%;text-align: center;color: #808080;">暂无数据</view>
					</view>

				</view>
			</view>
		</view><!-- box -->
	</view>
</template>

<script>
	import {
		toast,
		showLoading,
		hideLoading
	} from '@/utils/toast.js';
	import {
		getRepairListApi,
		getRepairDetailApi
	} from '@/http/api.js';
		export default {
			data() {
				return {
					pageIndex: 1,
					pageSize: 10,
					list: []
				}
			},
			onLoad() {
				this.getRepairList();
			},
			methods: {
				getRepairList() {
					let that = this;
					showLoading('加载中..');
					getRepairListApi({
						userId: uni.getStorageSync('userId'),
						pageIndex: this.pageIndex,
						pageSize: this.pageSize,
					}).then(res => {
						if (res.data.hasNextPage) {
							that.pageIndex = res.data.hasNextPage + 1;
						}
						for (let i in res.data.data) {
							that.list.push(res.data.data[i])
						}
						hideLoading();
					}).catch(err => {
						hideLoading();
					})
				}
			}
		}
</script>

<style>
	.menu_content_box_page {
		position: relative;
		/* height: 100vh; */
		background-color: #f7f6f6;
	}

	.area_block_1 {
		position: relative;
		padding: 32rpx 20rpx;
		background-color: #fff;
		border-radius: 20rpx;
	}

	.watermark_img_pos {
		position: absolute;
		top: 86rpx;
		right: 20rpx;
		width: 92rpx;
		height: 92rpx;
		z-index: 2;
	}

	.see_btn {
		display: inline-block;
		width: 112rpx;
		height: 48rpx;
		line-height: 48rpx;
		text-align: center;
		font-size: 22rpx;
		color: #fff;
		text-align: center;
		background-image: linear-gradient(90deg, #f46933, #e3140b);
		border-radius: 24rpx;
	}
</style>
